from django.contrib import admin
from server.apps.blogs.models import BlogPost, Users

admin.site.register(Users)

@admin.register(BlogPost)
class BlogPostAdmin(admin.ModelAdmin):
    """Admin panel for BlogPostAdmin."""

    list_display = (
        'id',
        'title',
        # 'category_name',
        # 'is_published',
        'created_at',
        'updated_at',
    )
    # list_select_related = ('category',)
    # list_filter = ('category', 'tags', 'is_published')
    # raw_id_fields = ('category',)
    # search_fields = ('id', 'title', 'body')
    # filter_horizontal = ('tags', 'tags')
    # date_hierarchy = 'created_at'

    # def category_name(self, instance: BlogPost) -> str:
    #     return instance.category.name if instance.category else 'None'
